home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Games / Abalone 1.4.2 / src / Connection.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-09-21  |  1.8 KB  |  73 lines  |  [TEXT/MPS ]

  1. #ifndef CONNECTION_H
  2. #define CONNECTION_H
  3.  
  4. #include <Types.h>
  5. #include <MixedMode.h>
  6. #include <AppleEvents.h>
  7.  
  8. #include "Global.h"
  9. #include "Rules.h"
  10.  
  11. Boolean            Connected (void);
  12. //    Is there a net play going on?
  13.  
  14. void            InitConnection(void);
  15. //    To be called at program init time to establish network connection
  16.  
  17. OSErr            ConnectionProtocol (void);
  18. //    Performs the connection protocol.
  19.  
  20. void            ReSyncProtocol (void);
  21.  
  22. void            SynchronisationProtocol (short player);
  23. //    When an out-of-sync is discovered with a certain player,
  24. //    this protocol resets the board to the earliest of the two boards.
  25.  
  26. void            CancelNetPlay (void);
  27. //
  28.  
  29. void            BreakConnections (void);
  30. //    Breaks all the current connections, and informs the other players of this.
  31.  
  32. OSErr            BroadcastMove (MovePtr move, short player, long checksum);
  33. //    Sends the move to all known network players
  34.  
  35.  
  36. //    Network address management functions
  37.  
  38. Boolean            IsConnected (short player);
  39. Boolean            ConnectState (SettingsPtr settings, short player);
  40.  
  41. AEAddressDesc    *GetNetAddress (short player);
  42. //    Returns the network address for the player
  43.  
  44. void            SetNetAddress (AEAddressDesc *address, short player);
  45. //    Sets the network addres for the player.
  46. //    MakeTarget can be used to get a valid network address
  47.  
  48. void            ClearNetAddress (short player);
  49.  
  50. void    MatchSettings (SettingsPtr sample, SettingsPtr destination);
  51. //    Makes the settings such that they can be used to play against sample.
  52. //    Destination samples are usually modified;
  53. //    Sample settings may be modified as well to replace Mac players by humans.
  54.  
  55. //    Just for testing
  56. void    DoNetTestMenu (short);
  57.  
  58.  
  59. #endif
  60.  
  61.  
  62. #ifdef CONNECTION_C
  63.  
  64. #include "AEHandler.h"
  65. #include "AppleEvent.h"
  66. #include "Interface.h"
  67. #include "Define.h"
  68. #include "Global.h"
  69. #include "Settings.h"
  70.  
  71.  
  72. pascal Boolean    AbalonePortFilter (LocationNamePtr locationName, PortInfoPtr thePortInfo);
  73. #endif